//
//  NoDataPromptView.m
//  BestPurchase
//
//  Created by ZSMAC on 2018/10/16.
//  Copyright © 2018年 张帅. All rights reserved.
//

#import "NoDataPromptView.h"

@implementation NoDataPromptView {
    UIImageView * imageView;
    UILabel * label;
}

- (id)initWithFrame:(CGRect)frame {
    self=[super initWithFrame:frame];
    if (self) {
        [self uiConfigure];
    }
    return self;
}
- (void)uiConfigure {
    CGFloat width = 150;
    imageView = [[UIImageView alloc] initWithFrame:CGRectMake((self.width/2)-(width/2), 10, width, 100)];
    imageView.layer.cornerRadius=0.5;
    imageView.contentMode=UIViewContentModeScaleAspectFill;
    [self addSubview:imageView];
    
    label = [[UILabel alloc] initWithFrame:CGRectMake((self.width-150)/2,imageView.bottom+5, 150, 50)];
    label.textAlignment = NSTextAlignmentCenter;
    
    label.numberOfLines = 0;
    label.font = Font(14);
    label.textColor = [UIColor lightGrayColor];
    [self addSubview:label];
    
}
- (void)setShowType:(NotDataType)showType {
    _showType=showType;
     if (_showType==Not_Data_Type) {
         imageView.image=[UIImage imageNamed:@"无数据.png"];
         label.text=@"暂无数据";
     }
}

@end
